<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <f:view contentType="text/html" encoding="utf-8">
      <h:head/>
<h:body>

<p:tabMenu activeIndex="2">
    		<p:menuitem value="AreaPersonale" url="index.xhtml" icon="ui-icon-person" />
    	</p:tabMenu>
    <br/><br/>
<h:form id="form">

	<p:dataGrid var="hotel" value="#{hotelBean.hotelList}" columns="3"
		rows="12" paginator="true"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
		rowsPerPageTemplate="9,12,15">

        <p:panel header="#{hotel.hid}" style="text-align:center">
            <h:panelGrid columns="1" style="width:100%"> 

                <h:outputText value="Località : #{hotel.località}" /><br/>
				<h:outputText value="Costo Per Giorno : #{hotel.costoPerGiorno}" /><br/>
				
                <p:commandLink update=":form:hotelDetail" oncomplete="PF('hotelDialog').show()" title="View Detail">
                    <h:outputText styleClass="ui-icon ui-icon-search" style="margin:0 auto;" /> 
                    <f:setPropertyActionListener value="#{hotel}" 
                            target="#{hotelBean.current}" />
                </p:commandLink>
            </h:panelGrid>
        </p:panel>

	</p:dataGrid>
	
	<p:dialog header="hotelDetail" widgetVar="hotelDialog" modal="true">
		<p:outputPanel id="hotelDetail" style="text-align:center;">
			
			<h:panelGrid  columns="2" cellpadding="5">
				<h:outputLabel for="hid" value="HID: " />
				<h:outputText id="hid" value="#{hotelBean.current.hid}" />
				
				<h:outputLabel for="descrizione" value="Descrizione: " />
				<h:outputText id="descrizione" value="#{hotelBean.current.descrizione}" />
				
				<h:outputLabel for="località" value="Località: " />
				<h:outputText id="località" value="#{hotelBean.current.località}" />
				
				<h:outputLabel for="costo" value="Costo Per Giorno: " />
				<h:outputText id="costo" value="#{hotelBean.current.costoPerGiorno}" />
				
				<h:outputLabel for="stelle" value="Stelle: " />
				<h:outputText id="stelle" value="#{hotelBean.current.stelle}" />
				
				<p:commandButton value="Modifica Hotel" action="modificaHotel.xhtml" /><br/>
				<p:commandButton value="Rimuovi Hotel" action="rimuoviHotel.xhtml" />
				
			</h:panelGrid>
		</p:outputPanel>
	</p:dialog>

</h:form>
</h:body>
</f:view>		
</html>